<template>
  <div>

	  <myheader></myheader>

	  <br /><br />

	  <Breadcrumb :datas="datas"></Breadcrumb>
	
	<section class="featured-block text-center">
		<div class="container">
            商品修改: <input type="text" v-model="cname">
            <br><br>
            <Button @click="update">修改</Button>

		</div>
	</section>
	
	<mufooter></mufooter>

  </div>
  
</template>


 
<script>

//组件包含
import myheader from './myheader.vue';
import myfooter from './myfooter.vue';

export default {
  data () {
    return {
		//声明面包屑导航变量
	    datas:[{title:"首页",route:{name:'index'}},{title:'商品分类页面',route:{name:'editcategory'}}],
        id:'',
        cname:'',

    }
  },
  //定义组件
  components:{
	  'myheader':myheader,
	  'mufooter':myfooter,
	},
  mounted:function(){


},
  methods:{
     update:function(){
         this.axios({
             method:'options',
             url:'http://localhost:8000/category/',
             data:{
                 id:this.$route.query.id,
                 cname:this.cname
             }
         }).then((result)=>{
            console.log(result)
            this.$Message(result.data.message)
            this.$router.push('/editcategory')
         })
     }
  }
}


</script>
 
<style>



</style>